home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / browsers / pwbrowse / browse.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1993-11-08  |  8.1 KB  |  229 lines

  1. VERSION 2.00
  2. Begin Form frmBrowse 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "WINDOWS Magazine Version Browser"
  6.    ClientHeight    =   3495
  7.    ClientLeft      =   2040
  8.    ClientTop       =   3300
  9.    ClientWidth     =   6900
  10.    Height          =   4245
  11.    Icon            =   BROWSE.FRX:0000
  12.    Left            =   1950
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    ScaleHeight     =   3495
  16.    ScaleWidth      =   6900
  17.    Top             =   2640
  18.    Width           =   7080
  19.    Begin TextBox tbName 
  20.       Height          =   285
  21.       Left            =   240
  22.       TabIndex        =   1
  23.       Text            =   "tbName"
  24.       Top             =   480
  25.       Width           =   3135
  26.    End
  27.    Begin ComboBox cbTypes 
  28.       Height          =   300
  29.       Left            =   240
  30.       Style           =   2  'Dropdown List
  31.       TabIndex        =   7
  32.       Top             =   3000
  33.       Width           =   3135
  34.    End
  35.    Begin FileListBox filBrowse 
  36.       Height          =   1590
  37.       Left            =   240
  38.       MultiSelect     =   2  'Extended
  39.       TabIndex        =   2
  40.       Top             =   960
  41.       Width           =   3135
  42.    End
  43.    Begin DirListBox dirBrowse 
  44.       Height          =   1830
  45.       Left            =   3600
  46.       TabIndex        =   5
  47.       Top             =   720
  48.       Width           =   3135
  49.    End
  50.    Begin DriveListBox drvBrowse 
  51.       Height          =   315
  52.       Left            =   3600
  53.       TabIndex        =   8
  54.       Top             =   3000
  55.       Width           =   3135
  56.    End
  57.    Begin Label Label12 
  58.       BackStyle       =   0  'Transparent
  59.       Caption         =   "Dri&ves:"
  60.       Height          =   255
  61.       Left            =   3600
  62.       TabIndex        =   6
  63.       Top             =   2760
  64.       Width           =   1095
  65.    End
  66.    Begin Label Label3 
  67.       BackStyle       =   0  'Transparent
  68.       Caption         =   "List Files of &Type:"
  69.       Height          =   255
  70.       Left            =   240
  71.       TabIndex        =   3
  72.       Top             =   2760
  73.       Width           =   1815
  74.    End
  75.    Begin Label lblCurDir 
  76.       BackStyle       =   0  'Transparent
  77.       Caption         =   "lblCurDir"
  78.       Height          =   255
  79.       Left            =   3600
  80.       TabIndex        =   9
  81.       Top             =   480
  82.       Width           =   3135
  83.    End
  84.    Begin Label Label2 
  85.       BackStyle       =   0  'Transparent
  86.       Caption         =   "&Directories:"
  87.       Height          =   255
  88.       Left            =   3600
  89.       TabIndex        =   4
  90.       Top             =   240
  91.       Width           =   1335
  92.    End
  93.    Begin Label Label1 
  94.       BackStyle       =   0  'Transparent
  95.       Caption         =   "File &Name:"
  96.       Height          =   255
  97.       Left            =   240
  98.       TabIndex        =   0
  99.       Top             =   240
  100.       Width           =   975
  101.    End
  102.    Begin Menu mnuFile 
  103.       Caption         =   "&File"
  104.       Begin Menu mnuFilePrint 
  105.          Caption         =   "&Print ..."
  106.          Shortcut        =   ^P
  107.       End
  108.       Begin Menu mnuFileSep 
  109.          Caption         =   "-"
  110.       End
  111.       Begin Menu mnuFileExit 
  112.          Caption         =   "E&xit"
  113.       End
  114.    End
  115.    Begin Menu mnuHelp 
  116.       Caption         =   "&Help"
  117.       Begin Menu mnuHelpAbout 
  118.          Caption         =   "&About ..."
  119.          WindowList      =   -1  'True
  120.       End
  121.    End
  122. Sub cbTypes_Click ()
  123.     Dim Pat As String
  124.     Dim l, r As Integer
  125.     Pat = cbTypes.List(cbTypes.ListIndex)
  126.     l = InStr(Pat, "(") + 1
  127.     r = InStr(l, Pat, ")")
  128.     filBrowse.Pattern = Mid$(Pat, l, r - l)
  129.     tbName.Text = filBrowse.Pattern
  130. End Sub
  131. Sub dirBrowse_Change ()
  132.     lblCurDir.Caption = dirBrowse.List(dirBrowse.ListIndex)
  133.     filBrowse.Path = dirBrowse.Path
  134. End Sub
  135. Sub drvBrowse_Change ()
  136.     dirBrowse.Path = drvBrowse.Drive
  137. End Sub
  138. Sub filBrowse_DblClick ()
  139.     Dim FullName As String
  140.     Dim Result As Integer
  141.     Dim VI As VerInfo
  142.     FullName = filBrowse.Path + "\" + filBrowse.List(filBrowse.ListIndex)
  143.     frmDisp!lblName.Caption = FullName
  144.     frmDisp!lblSize.Caption = Format$(FileLen(FullName), "###,###,###,##0 \b\y\t\e\s")
  145.     frmDisp!lblDate.Caption = Format$(FileDateTime(FullName), "dddd, mmmm d, yyyy \a\t h:mm AM/PM")
  146.     Result = GetFileVersion(FullName, VI)
  147.     frmDisp!lblFileVersion.Caption = VI.FileVersion
  148.     frmDisp!lblFileDescription.Caption = VI.FileDescription
  149.     frmDisp!lblCompanyName.Caption = VI.CompanyName
  150.     frmDisp!lblLanguage.Caption = VI.Language
  151.     frmDisp!lblComments.Caption = VI.Comments
  152.     frmDisp!lblOriginalFileName.Caption = VI.OriginalFileName
  153.     frmDisp!lblInternalName.Caption = VI.InternalName
  154.     frmDisp!lblCopyright.Caption = VI.LegalCopyright
  155.     frmDisp!lblTrademarks.Caption = VI.LegalTrademarks
  156.     frmDisp!lblProductName.Caption = VI.ProductName
  157.     frmDisp!lblProductVersion.Caption = VI.ProductVersion
  158.     frmDisp!lblPrivateBuild.Caption = VI.PrivateBuild
  159.     frmDisp!lblSpecialBuild.Caption = VI.SpecialBuild
  160.     frmDisp.Show 0
  161. End Sub
  162. Sub Form_Load ()
  163.     Dim Default As Integer
  164.     Dim Result As Integer
  165.     ' Load choices into File Type Dropdown list box
  166.     cbTypes.AddItem "All Executables (*.EXE;*.DLL;*.DRV;*.VBX;*.CPL;*.286;*.386;*.2GR;*.3GR;*.FOT;*.FON)"
  167.     cbTypes.AddItem "EXEs (*.EXE)"
  168.     cbTypes.AddItem "DLLs (*.DLL)"
  169.     cbTypes.AddItem "Drivers (*.DRV)"
  170.     cbTypes.AddItem "VB eXtensions (*.VBX)"
  171.     cbTypes.AddItem "Control Panel Applet (*.CPL)"
  172.     cbTypes.AddItem "Standard Mode Driver (*.286)"
  173.     cbTypes.AddItem "Enhanced Mode Driver (*.386)"
  174.     cbTypes.AddItem "Standard Mode Grabber (*.2GR)"
  175.     cbTypes.AddItem "Enhanced Mode Grabber (*.3GR)"
  176.     cbTypes.AddItem "TrueType Fonts (*.FOT)"
  177.     cbTypes.AddItem "Other Fonts (*.FON)"
  178.     cbTypes.ListIndex = 0 ' set default to All Executables
  179.     lblCurDir.Caption = dirBrowse.List(dirBrowse.ListIndex)
  180.     ' move forms to position they had at end of last run
  181.     Default = (Screen.Height - frmBrowse.Height) / 2
  182.     Result = GetPrivateProfileInt("VerBrowse", "Top", Default, "WINMAG.INI")
  183.     frmBrowse.Top = Result
  184.     Default = (Screen.Width - frmBrowse.Width) / 2
  185.     Result = GetPrivateProfileInt("VerBrowse", "Left", Default, "WINMAG.INI")
  186.     frmBrowse.Left = Result
  187.     Default = (Screen.Height - frmDisp.Height) / 2
  188.     Result = GetPrivateProfileInt("VerDisp", "Top", Default, "WINMAG.INI")
  189.     DispTop = Result
  190.     frmDisp.Top = DispTop
  191.     Default = (Screen.Width - frmDisp.Width) / 2
  192.     Result = GetPrivateProfileInt("VerDisp", "Left", Default, "WINMAG.INI")
  193.     DispLeft = Result
  194.     frmDisp.Left = DispLeft
  195.     Default = (Screen.Height - frmPrint.Height) / 2
  196.     Result = GetPrivateProfileInt("VerPrint", "Top", Default, "WINMAG.INI")
  197.     PrintTop = Result
  198.     frmPrint.Top = PrintTop
  199.     Default = (Screen.Width - frmPrint.Width) / 2
  200.     Result = GetPrivateProfileInt("VerPrint", "Left", Default, "WINMAG.INI")
  201.     PrintLeft = Result
  202.     frmPrint.Left = PrintLeft
  203. End Sub
  204. Sub Form_Unload (Cancel As Integer)
  205.     Unload frmDisp
  206.     Unload frmPrint
  207.     ' save the form position for next time
  208.     Result = WritePrivateProfileString("VerBrowse", "Top", Format$(frmBrowse.Top), "WINMAG.INI")
  209.     Result = WritePrivateProfileString("VerBrowse", "Left", Format$(frmBrowse.Left), "WINMAG.INI")
  210.     Result = WritePrivateProfileString("VerDisp", "Top", Format$(DispTop), "WINMAG.INI")
  211.     Result = WritePrivateProfileString("VerDisp", "Left", Format$(DispLeft), "WINMAG.INI")
  212.     Result = WritePrivateProfileString("VerPrint", "Top", Format$(PrintTop), "WINMAG.INI")
  213.     Result = WritePrivateProfileString("VerPrint", "Left", Format$(PrintLeft), "WINMAG.INI")
  214.     End
  215. End Sub
  216. Sub MnuFileExit_Click ()
  217.     Unload frmBrowse
  218. End Sub
  219. Sub MnuFilePrint_Click ()
  220.     frmPrint.Show 1 ' modal
  221. End Sub
  222. Sub mnuHelpAbout_Click ()
  223.     frmAbout.Show 1 ' show About box, wait till it exits
  224. End Sub
  225. Sub tbName_Change ()
  226.     On Error Resume Next ' so we can stuff incomplete info into .Pattern
  227.     filBrowse.Pattern = tbName.Text
  228. End Sub
  229.